<template>
  <div id="jackpotlist"> 


          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">

                <el-table-column label="账号"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span>{{ scope.row.telphone }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="姓名"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span>{{ scope.row.nickname }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="剩余天数"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span>{{ scope.row.day }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="金蛋"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span>{{ scope.row.jin_dan }}</span><span  class="see_span" @click="mtk1_but(scope.row,1)"><i class="el-icon-view el-icon--right"></i></span>
                    </template>
                </el-table-column>
                 <el-table-column label="彩蛋"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span>{{ scope.row.cai_dan }}</span><span  class="see_span" @click="mtk1_but(scope.row,2)"><i class="el-icon-view el-icon--right"></i></span>
                    </template>
                </el-table-column>
  
            </el-table>  


            <el-dialog title='奖励详情' :visible.sync="mtk1"  width="700px">
            <div style="width:100%;"> 
  
             <el-table :data="mtk1_form.datalist" style="width: 100%" height="500px" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">
                 
                  <el-table-column label="时间"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ getNowDateSjc(scope.row.time*1000 )}}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="数量"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >
                            <span v-if="scope.row.flag == 'IN'"> + </span>
                            <span v-if="scope.row.flag == 'OUT'"> - </span>
                            {{ scope.row.change }}
                        </span>
                    </template>
                </el-table-column>
            </el-table> 

            <div style="margin-top:20px;text-align: center;">
                <el-pagination
                    background
                    @current-change="handleCurrentChange"
                    :page-size="10"  
                    layout="prev, pager, next, jumper"
                    :total="count">
                </el-pagination>
          </div>


            </div> 
        </el-dialog>
   
 
   </div>
</template>

<script>
export default {
   name: 'jackpotlist',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度
        page:1,
        count:0,
        my_uid:'',
        mtk1:false,
        mtk1_form:{
            datalist:[]
        },
        type:'',
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 298
      
  },
  mounted (){
    
  },
  methods: {
     
     mtk1_but(row,num){
        this.page = 1
        this.my_uid = row.uid
        this.type = num
        this.mtk1_fun()
        this.mtk1 = true
     },
     mtk1_fun(){
        this.post("/draw_lottery/detailOfMemberSurplus", {
              page:this.page,
              uid:this.my_uid,
              type:this.type,
	         }).then(res => {
                this.count = res.result.count
                this.mtk1_form.datalist = res.result.list
                //console.log(this.mtk1_form.datalist)
          })
     },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.mtk1_fun()
        console.log(`当前页: ${val}`);
      }
 
  }
}
</script>


<style scoped>

</style>